package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.dao.FeedbackDao;
import com.ytjj.qmyx.admin.model.request.FeedbackRequest;
import com.ytjj.qmyx.admin.model.response.FeedbackResponse;
import com.ytjj.qmyx.admin.service.FeedbackService;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Resource
    private FeedbackDao feedbackDao;

    @Override
    public CommonPage<FeedbackResponse> list(FeedbackRequest feedbackRequest) {
        PageHelper.startPage(feedbackRequest.getPageNum(),feedbackRequest.getPageSize());
        List<FeedbackResponse> pageList =  feedbackDao.selectList(feedbackRequest);
        return CommonPage.restPage(pageList);
    }

    @Override
    public int updateStatus(Integer id) {
        int count = feedbackDao.updateStatus(id);
        return count;
    }
}
